package read;

import java.io.*;

public class Old {
    public  void CopyFile(File source,File dest) throws IOException{

        FileInputStream in = new FileInputStream(source);
        FileOutputStream out = new FileOutputStream(dest);
        byte[] bs = new byte[1024];
        int count = 0;
        while ((count=in.read(bs, 0, bs.length))!=-1) {
            out.write(bs,0,count);
        }
        in.close();
        out.flush();
        out.close();


    }
    public static void main (String []args) throws IOException {
        Old old=new Old();
        File origin = new File("old.txt");
        File copy= new File("G:\\vaadin\\zhou43\\new.txt");
        old.CopyFile(origin,copy);

    }
}
